import request from '@/utils/request'

// 查询客户  
export const selectCustomerApi = (data) => {
  return request({
    url: '/system/customer/selectCustomer',
    method: 'get',
    params: data
  })
}
// 新增客户
export const addInsertCustApi = (data) => {
  return request({
    url: '/system/customer/insertCust',
    method: 'post',
    data
  })
}
// 修改客户等级
export const updateCustRankApi = (data) => {
  return request({
    url: '/system/customer/updateCustRank',
    method: 'post',
    data
  })
}
// 客户管理页面修改接口
export const updateCust = (data) => {
  return request({
    url: '/system/customer/updateCust',
    method: 'put',
    data
  })
}
// 客户联系人页面修改接口
export const updateCustAlternative = (data) => {
  return request({
    url: '/system/customer/updateCustAlternative',
    method: 'put',
    data
  })
}
// 客户联系人页面删除
export const deleteCustomer = (params) => {
  return request({
    url: '/system/customer/remove',
    method: 'get',
    params
  })
}
// 新增拜访 /system/records
export const addRecords = (data) => {
  return request({
    url: '/system/records/add',
    method: 'post',
    data
  })
}
// 查询拜访 /system/records
export const getRecords = (params) => {
  return request({
    url: '/system/records/list',
    method: 'get',
    params
  })
}
// 详情拜访 /system/records
export const getInfoRecords = (params) => {
  return request({
    url: '/system/records/getInfo',
    method: 'get',
    params
  })
}

// 客户订单查询接口           

export const getProductionItemsOrderList = (params) => {
  return request({
    url: '/system/records/productionItemsOrderList',
    method: 'get',
    params
  })
}


// 查询合同信息列表
export function listContracts(query) {
  return request({
    url: '/system/contracts/list',
    method: 'get',
    params: query
  })
}

// 查询合同信息详细
export function getContracts(contractId) {
  return request({
    url: '/system/contracts/' + contractId,
    method: 'get'
  })
}

// 新增合同信息
export function addContracts(data) {
  return request({
    url: '/system/contracts',
    method: 'post',
    data
  })
}

// 修改合同信息
export function updateContracts(data) {
  return request({
    url: '/system/contracts',
    method: 'put',
    data
  })
}

// 删除合同信息
export function delContracts(contractId) {
  return request({
    url: '/system/contracts/' + contractId,
    method: 'delete'
  })
}
